package test;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.InfixtoPostfixTranslator;

public class ChristianMarinIPTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test1() {
		assertEquals("4 5 1 / + 2 +", InfixtoPostfixTranslator.eval(" 4 + 5 / 1 + 2 "));
	}
	@Test
	public void test2() {
		assertEquals("500 1 + 37 3 + 2 ^ *", InfixtoPostfixTranslator.eval(" ( 500 + 1 ) * ( 37 + 3 ) ^ 2 "));
	}
	@Test
	public void test3() {
		assertEquals("40 5 + 2 ^ 5 5 / 2 * +", InfixtoPostfixTranslator.eval("( 40 + 5 ) ^ 2 + 5 / 5 * 2 "));
	}
	@Test
	public void test4() {
		assertEquals("2 4 * 2 / 4 * 2 2 + 2 ^ +", InfixtoPostfixTranslator.eval(" 2 * 4 / 2 * 4 + ( 2 + 2 ) ^ 2 "));
	}
	@Test
	public void test5() {
		assertEquals("2 2 + 2 + 2 2 / 4 4 + * 2 / 2 2 ^ * +", InfixtoPostfixTranslator.eval(" 2 + 2 + 2 + 2 / 2 * ( 4 + 4 ) / 2 * 2 ^ 2 "));
	}

}
